<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="/lib/vue.js"></script>

</head>

<body>
  <div id="box">
    <h1>asc {{na}}</h1>
    <h2>{{age}}</h2>
    <button v-on:click="chufa">点我加1</button>
  </div>
  <script>
    var vu = new Vue({
      el: '#box',
      data: {
        na: '爱迪生',
        age: 18
      },
      methods: {
        chufa: function () {
          // age + 1
          // 指的是当前vue实例
          this.age++
          console.log(this);
          this.tixing()
          // alert(1)
        },
        tixing: function () {
          console.log(this.age);
        }
      }
    })
  </script>
</body>

</html>